﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using TaoSH.AppCode;

namespace TaoSH.MG
{
    public partial class Login : System.Web.UI.Page
    {
        public string strNameL
        {
            get { return Request.QueryString["userid"] ?? "-1"; }
        }

        public string strPassWord
        {
            get { return Request.QueryString["password"] ?? "-1"; }
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {

            }
        }


        protected void btLogin_Click(object sender, EventArgs e)
        {
            string strUserName = Request["username"].ToString();
            string strPassWord = Request["userpasd"].ToString();

            if (strUserName == "" || strPassWord == "")
            {
                lblMsg.Text = "用户名和密码不能为空";
                return;
            }

            JH_Auth_UserB BUser = new JH_Auth_UserB();
            if (BUser.GetEntity(d => d.UserName == strUserName && d.UserPass == strPassWord && d.IsUse == "Y") != null)
            {
                Session["UserName"] = strUserName;
                Response.Redirect("View/IndexNTab.aspx", false);

            }
            else
            {
                lblMsg.Text = "用户名或密码错误";
            }
        }
    }
}